(function () {
    "use strict";

    divisionBy3OfDigits(12);
    divisionBy3OfDigits(179);
    divisionBy3OfDigits(591);

    function divisionBy3OfDigits(value) {
        var sum = 0;

        for (var i = 0; i < value.toString().length; i++) {
            sum += parseInt(value.toString()[i]);
        }

        if (sum % 3 === 0) {
            console.log('the number is divided by 3 without reminder');
        }
        else {
            console.log('the number is not divided by 3 without reminder');
        }
    }
}());